/************************************************************
* @file   gkt_types.h
************************************************************/

#ifndef GKT_TYPES_H
#define GKT_TYPES_H

#include "gkt_config.h"
#include "gkt_defines.h"

typedef uint32_t gkt_handle_t;
#define GKT_HANDLE_INVALID	0

/* TIMEOUT */
#define GKT_IMMEDIATELY	0
#define GKT_INFINITE	((uint32_t)~0)

/* Return Value & errno */
#define GKT_SUCCESS	0
#define GKT_EPARAM	-1	/* parameter(s) invalid */
#define GKT_EBUSY	-2	/* busy */
#define GKT_ETIMEOUT	-3	/* timeout */
#define GKT_ENOMEMORY	-4	/* no available memory */
#define GKT_ENORESOURCE	-5	/* no resource */
#define GKT_EPERMIT	-6		/* forbidden/no access */
#define GKT_EUNDESIRED	-7	/* undesired */
#define GKT_EAGAIN	-8		/* try it later */
#define GKT_EINCOMPLETE	-9
#define GKT_EALREADYEXIST	-10		/* already exist */
#define GKT_ENOTEXIST	-11	/* not exist */
#define GKT_ENOTSUPPORT	-12
#define GKT_ENOTINIT	-13
#define GKT_EINVALIDCONFIG	-14
#define GKT_ENOTCONFIG	-15
#define GKT_ENOTOPEN	-16
#define GKT_ENOTSTART	-17
#define GKT_ENOTENABLE	-18
#define GKT_ENOMATCHED	-19
#define GKT_EREPETITIVE	-20	/* repetitive operation */
#define GKT_EIDENTICAL	-21
#define GKT_EINPROCESS	-22
#define GKT_EDATALOSS	-23
#define GKT_EPAUSED		-24
#define GKT_ETERMINATED	-25
#define GKT_ELOWLEVEL	-26	/* low level error occurs */
#define GKT_EOVERMUCH	-27
#define GKT_ECREATE		-28
#define GKT_EDECODE		-29
#define GKT_EALREADY	-30
#define GKT_EENDOFFILE	-31
#define GKT_EUNMATCHED	-32
#define GKT_EUNAVAILABLE -33
#define GKT_EOVERFLOW	-34
#define GKT_EUNDERFLOW	-35
#define GKT_ECAPACITY	-36	/* exceeded maximum capacity */
#define GKT_EUNALIGN	-37
#define GKT_ENEEDLESS	-38
#define GKT_ECONFLICT	-39
#define GKT_ENOTEXCUTE	-40	
#define GKT_EFATAL	-126
#define GKT_EUNKNOWN	-127

/* aging_test return value & errno shift*/
#define GKT_AGING_TEST_EKEY		(1<<31)
#define GKT_AGING_TEST_EFPS		(1<<30)
#define GKT_AGING_TEST_ECARD	(1<<29)
#define GKT_AGING_TEST_EBLE		(1<<28)
#define GKT_AGING_TEST_EPOWER	(1<<27)
#define GKT_AGING_TEST_EFLASH	(1<<26)
#define GKT_AGING_TEST_EEND_BIT	(22)

/* rectange */
typedef struct _gkt_rect {
	uint16_t	x;
	uint16_t	y;
	uint16_t	width;
	uint16_t	height;
} gkt_rect_s;

/* module location */
#define GKT_MODULE_LOC_UNKNOWN	0
#define GKT_MODULE_LOC_FRONTBOARD	1
#define GKT_MODULE_LOC_BACKBOARD	2
#define GKT_MODULE_LOCATION_L2(mod_loc)	\
	GKT_MODULE_LOC_##mod_loc
#define GKT_MODULE_LOCATION_L1(mod_loc)	\
	GKT_MODULE_LOCATION_L2(mod_loc)
#define GKT_MODULE_LOCATION(mod_loc)	\
	GKT_MODULE_LOCATION_L1(mod_loc)

#endif	/* GKT_TYPES_H */

